package String;

import java.util.Scanner;

public class Demo {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String email = in.nextLine();
        do {
            System.out.println("请输入邮箱地址");
            email = in.nextLine();
            //检查email的正确性

        }while (email == null ||
                email.equals(" ")||
                email.indexOf("@")==-1);
        //得到正确的email
        int index = email.indexOf("@");
        String name = email.substring(0,index);
        String host = email.substring(index+1);
        System.out.println(name);
        System.out.println(host);

    }
}
